{% extends 'base.html' %}  

{% block title %}删除交易 - SaveStar{% endblock %}  

{% block page_title %}删除交易{% endblock %}  

{% block content %}  
<div class="row justify-content-center">  
    <div class="col-md-6">  
        <div class="card">  
            <div class="card-header bg-danger text-white">  
                <h5 class="mb-0">确认删除</h5>  
            </div>  
            <div class="card-body">  
                <p>您确定要删除交易 <strong>{{ transaction.name }}</strong> 吗？</p>  
                <p>删除此交易将调整相关钱包的余额。此操作不可恢复。</p>  
                
                <div class="card mb-3">  
                    <div class="card-body">  
                        <div class="row">  
                            <div class="col-md-6">  
                                <p><strong>交易日期：</strong> {{ transaction.transaction_date|date:"Y-m-d H:i" }}</p>  
                                <p><strong>交易类型：</strong> {{ transaction.get_type_display }}</p>  
                                <p><strong>金额：</strong> ¥{{ transaction.amount|floatformat:2 }}</p>  
                            </div>  
                            <div class="col-md-6">  
                                <p><strong>钱包：</strong> {{ transaction.wallet.name }}</p>  
                                <p><strong>分类：</strong> {{ transaction.category.name|default:"无分类" }}</p>  
                            </div>  
                        </div>  
                    </div>  
                </div>  
                
                <form method="post">  
                    {% csrf_token %}  
                    <div class="d-flex justify-content-between">  
                        <a href="{% url 'transaction_list' %}" class="btn btn-outline-secondary">取消</a>  
                        <button type="submit" class="btn btn-danger">确认删除</button>  
                    </div>  
                </form>  
            </div>  
        </div>  
    </div>  
</div>  
{% endblock %}